Skip to content

[pull] master from mozilla:master - #498

Merged
pull[bot] merged 12 commits into
code:masterfrom
mozilla:master
Aug 13, 2026
Merged

[pull] master from mozilla:master#498
pull[bot] merged 12 commits into
code:masterfrom
mozilla:master

Conversation

@pull

@pull pull Bot commented Aug 13, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Jaybhade and others added 12 commits August 8, 2026 00:21
The rule rewrites `Math.max(C, Math.min(A, B))` to `MathClamp(A, C, B)`, always
taking the inner call's first operand as the value. `Math.min` is commutative,
so the value is just as often the second one, and then the fixer swaps it with
the upper bound: the result is `Math.min(C, v)`, which no longer applies the
lower bound at all. Both call sites the fixer rewrote hit that case, so the
max-outer patterns are now reported without a fix.

Reporting them still needs its own message. `Math.max(C, Math.min(A, B))` is
only `MathClamp(A, C, B)` when `C <= B`, and the rule can't know whether that
holds, so telling the reader to "use MathClamp" is wrong advice. The message
states the condition instead, and `useClamp` is left to the min-outer patterns,
which are exact.

In `PSStackBasedInterpreter.build` the outputs were therefore never clamped up
to the Range minimum. The interpreter runs whenever `PSStackToTree` can't turn
the program into a tree — a stack-shrinking `if`, or a `copy`/`index`/`roll`
whose operand isn't a constant — and it then let a Type 4 function return e.g.
-1.5 for a component declared as `/Range [0 1]`.

In `SplitView.#clampFirstSize` the first pane's size was never clamped up to
`#minSize`: dragging the resizer past it wrote a negative `flexGrow`.

The existing range-clamping test only checked the upper bound, which is the one
the wrong operand order preserves.
… Map

Using a Map seems more appropriate given that there's a bunch of adding/removing of entries, and it's especially helpful at the end of the getter since it's easy/efficient to determine its size (whereas an Object requires iterating though it to do that).
Given that the relevant worker-thread message handler is conditionally defined, note [this code](https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/worker.js#L987-L1005), it makes sense to do the same thing on the main-thread as well.
This way we avoid bundling a small amount of unused code in e.g. the Firefox PDF Viewer.
…ices`

There's no point in first checking if something is a number, when we *immediately* afterwards have a `Number.isInteger(...)` check.
Only define the `getRawData` API methods when building INTERNAL_VIEWER
…ypeof

Remove unnecessary `typeof` check in `Field.prototype.currentValueIndices`
Avoid creating a couple of intermediate Arrays
Fix the two MathClamp calls the prefer-math-clamp fixer mis-ordered
…nt-simplify

Simplify the `Stepper.prototype.getNextBreakPoint` method
…ttributes-Map

Let the `StructElementNode.prototype.tableAttributes` getter return a Map
@pull pull Bot locked and limited conversation to collaborators Aug 13, 2026
@pull pull Bot added the ⤵️ pull label Aug 13, 2026
@pull
pull Bot merged commit aef18a9 into code:master Aug 13, 2026
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 13, 2026 20:03 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants